<template>
  <q-input class="" :model-value="开奖日期" outlined readonly label="开奖日期" label-color="orange" size="1">
    <template v-slot:append>
      <q-btn icon="event" round color="primary" push size="sm">
        <q-popup-proxy cover transition-show="scale" transition-hide="scale">
          <q-date v-model="开奖日期" mask="YYYY年MM月DD日">
            <div class="row items-center justify-end q-gutter-sm">
              <q-btn label="今天" color="secondary" @click="指定为今天()" push />
              <q-btn label="OK" color="primary" push v-close-popup />
            </div>
          </q-date>
        </q-popup-proxy>
      </q-btn>
    </template>
  </q-input>
</template>

<script setup>
import { useStore } from '../stores/store'
const store = useStore()
import { ref, reactive, computed, watch, onMounted, onBeforeUnmount, onUnmounted } from "vue";

const 开奖日期=ref('')
onMounted(() => {
  开奖日期.value=props.父级开奖日期
})

function 指定为今天() {
  开奖日期.value = store.今天日期()
}
watch(开奖日期,  (newVal, oldVal) => {
  emit('update:开奖日期', newVal,"aaa")
})
const props = defineProps({
  父级开奖日期: {
  },
});

const emit = defineEmits(['update:开奖日期'])

</script>

<style lang="scss" scoped></style>
